#include "tinyfont.h"
#include <nds.h>

using namespace WoopsiUI;

static const u16 TinyFont_glyphdata[175] = {
/* '!' */	0x5440,
/* '"' */	0x7800,0x0000,
/* '#' */	0xBEFA,0x0000,
/* '$' */	0xFBBE,0x0000,
/* '%' */	0xA54A,0x0000,
/* '&' */	0x71D6,0x0000,
/* ''' */	0x2800,0x0000,
/* '(' */	0x6A40,
/* ')' */	0x4494,0x0000,
/* '*' */	0x1550,0x0000,
/* '+' */	0x0BA0,0x0000,
/* ',' */	0x0180,
/* '-' */	0x0380,0x0000,
/* '.' */	0x0040,
/* '/' */	0x2548,0x0000,
/* '0' */	0x56D4,0x0000,
/* '1' */	0xD540,
/* '2' */	0xC74E,0x0000,
/* '3' */	0xC71C,0x0000,
/* '4' */	0xB792,0x0000,
/* '5' */	0xF39C,0x0000,
/* '6' */	0xF3DE,0x0000,
/* '7' */	0xE524,0x0000,
/* '8' */	0xF7DE,0x0000,
/* '9' */	0xF792,0x0000,
/* ':' */	0x1100,
/* ';' */	0x1180,
/* '<' */	0x2A22,0x0000,
/* '=' */	0x1C70,0x0000,
/* '>' */	0x88A8,0x0000,
/* '?' */	0xE504,0x0000,
/* '@' */	0xF7CE,0x0000,
/* 'A' */	0xF7DA,0x0000,
/* 'B' */	0xD75C,0x0000,
/* 'C' */	0xF24E,0x0000,
/* 'D' */	0xD6DC,0x0000,
/* 'E' */	0xF34E,0x0000,
/* 'F' */	0xF348,0x0000,
/* 'G' */	0xF25E,0x0000,
/* 'H' */	0xB7DA,0x0000,
/* 'I' */	0x5540,
/* 'J' */	0xE92C,0x0000,
/* 'K' */	0xB75A,0x0000,
/* 'L' */	0x924E,0x0000,
/* 'M' */	0xFFDA,0x0000,
/* 'N' */	0xF6DA,0x0000,
/* 'O' */	0xF6DE,0x0000,
/* 'P' */	0xF7C8,0x0000,
/* 'Q' */	0xF6FE,0x0000,
/* 'R' */	0xF75A,0x0000,
/* 'S' */	0xF39E,0x0000,
/* 'T' */	0xE924,0x0000,
/* 'U' */	0xB6DE,0x0000,
/* 'V' */	0xB6D4,0x0000,
/* 'W' */	0xB7FE,0x0000,
/* 'X' */	0xB55A,0x0000,
/* 'Y' */	0xB524,0x0000,
/* 'Z' */	0xE54E,0x0000,
/* '[' */	0xEAC0,
/* '\' */	0x9112,0x0000,
/* ']' */	0xD5C0,
/* '^' */	0x5400,0x0000,
/* '_' */	0x000E,0x0000,
/* '`' */	0x9000,
/* 'a' */	0xF7DA,0x0000,
/* 'b' */	0xD75C,0x0000,
/* 'c' */	0xF24E,0x0000,
/* 'd' */	0xD6DC,0x0000,
/* 'e' */	0xF34E,0x0000,
/* 'f' */	0xF348,0x0000,
/* 'g' */	0xF25E,0x0000,
/* 'h' */	0xB7DA,0x0000,
/* 'i' */	0x5540,
/* 'j' */	0xE92C,0x0000,
/* 'k' */	0xB75A,0x0000,
/* 'l' */	0x924E,0x0000,
/* 'm' */	0xFFDA,0x0000,
/* 'n' */	0xF6DA,0x0000,
/* 'o' */	0xF6DE,0x0000,
/* 'p' */	0xF7C8,0x0000,
/* 'q' */	0xF6FE,0x0000,
/* 'r' */	0xF75A,0x0000,
/* 's' */	0xF39E,0x0000,
/* 't' */	0xE924,0x0000,
/* 'u' */	0xB6DE,0x0000,
/* 'v' */	0xB6D4,0x0000,
/* 'w' */	0xB7FE,0x0000,
/* 'x' */	0xB55A,0x0000,
/* 'y' */	0xB524,0x0000,
/* 'z' */	0xE54E,0x0000,
/* '{' */	0x2B22,0x0000,
/* '|' */	0x5540,
/* '}' */	0x89A8,0x0000,
/* '~' */	0x7800,0x0000,
};

static const u16 TinyFont_offset[94] = {
    0,    1,    3,    5,    7,    9,   11,   13,   14,   16,   18,   20,   21,   23,   24,   26,
   28,   29,   31,   33,   35,   37,   39,   41,   43,   45,   46,   47,   49,   51,   53,   55,
   57,   59,   61,   63,   65,   67,   69,   71,   73,   74,   76,   78,   80,   82,   84,   86,
   88,   90,   92,   94,   96,   98,  100,  102,  104,  106,  108,  109,  111,  112,  114,  116,
  117,  119,  121,  123,  125,  127,  129,  131,  133,  134,  136,  138,  140,  142,  144,  146,
  148,  150,  152,  154,  156,  158,  160,  162,  164,  166,  168,  170,  171,  173
};

static const u8 TinyFont_width[94] = {
 2, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 2, 3, 2, 3, 3,
 2, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 3, 3, 3, 3, 3,
 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3,
 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 2, 3, 3, 2,
 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3,
 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3
};

TinyFont::TinyFont(u8 fixedWidth) : PackedFont1 (
	33,
	126,
	TinyFont_glyphdata,
	TinyFont_offset,
	TinyFont_width,
	6,
	2,
	4,
	3
) {
	if (fixedWidth) setFontWidth(fixedWidth);
};
